function main() {
  //   app.launchApp("支付宝");
  //   sleep(3 * 1000);
  //   goHome();
  // openShizuku();
  //   wakeUp();
  // lockScreen();
  var performGlobalAction = runtime.accessibilityBridge.getService();
  console.log(performGlobalAction);
}
main();

function goHome() {
  var intent = new Intent();
  intent.setAction(Intent.ACTION_MAIN);
  intent.addCategory(Intent.CATEGORY_HOME);
  app.startActivity(intent);
}
function goRecents() {
  var intent = new Intent(Intent.ACTION_MAIN);
  intent.addCategory(Intent.CATEGORY_HOME);
  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  app.startActivity(intent);
}
function goSetting() {
  var intent = new Intent();
  intent.setAction("android.settings.SETTINGS");
  app.startActivity(intent);
}
function close() {
  var intent = new Intent();
  intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  app.startActivity(intent);
}

function openShizuku() {
  // adb shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh
  var res = shell(
    "sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh"
  );
  console.log(res);
}

function wakeUp() {
  device.wakeUp();
}
